package cn.edu.gdut.deepcode.context;
/**
 * <p>
 * 用户上下文
 * </p>
 *
 * @Author: 暮倦
 * @Since: 2025-04-08  21:04
 * @Version: 1.0.0
 */
public class UserContext {
    private static final ThreadLocal<Long> THREAD_LOCAL=new ThreadLocal<>();

    public static void setUser(Long id){
        THREAD_LOCAL.set(id);
    }

    public static Long getUser(){
        return THREAD_LOCAL.get();
    }

    public static void removeUser(){
        THREAD_LOCAL.remove();
    }
}
